package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ShoppingCartUserMapper {
    /**
     * 查询是否有
     * @param shoppingCart
     * @return
     */
    ShoppingCart findShoppingCartByUserAndOptions(ShoppingCart shoppingCart);

    /**
     * 更新number
     * @param dbshoppingCart
     */
    void updateNumberById(ShoppingCart dbshoppingCart);

    /**
     * 添加
     * @param shoppingCart
     */
    void save(ShoppingCart shoppingCart);


    /**
     * 查询所有
     * @param userId
     * @return
     */
    List<ShoppingCart> list(Long userId);

    void clean(Long userId);

    void delShoppingCartById(Long id);

    List<ShoppingCart> findByUserId(Long userId);
}
